package com.eamois.dao.manual.impl;

import java.io.Serializable;
import java.sql.SQLException;
import java.util.Collection;

import org.courser.hibernate.QueryExample;
import org.courser.ui.PaginationSupport;
import org.hibernate.Criteria;
import org.hibernate.HibernateException;
import org.hibernate.Session;
import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.Order;
import org.hibernate.criterion.Restrictions;
import org.springframework.orm.hibernate3.HibernateCallback;

import com.eamois.dao.impl.BaseDaoImpl;
import com.eamois.dao.manual.ProcessEntityColsDao;
import com.eamois.dao.manual.WorkStepColsDao;
import com.eamois.domain.manual.Catalog;
import com.eamois.domain.manual.EnsipEntity;
import com.eamois.domain.manual.ProcessEntity;
import com.eamois.domain.manual.ProcessEntityCols;
import com.eamois.domain.manual.WorkStep;
import com.eamois.domain.manual.WorkStepCols;

public class WorkStepColsDaoImpl extends BaseDaoImpl<WorkStepCols> implements
		WorkStepColsDao {
	@SuppressWarnings("unchecked")
	@Override
	public Collection<WorkStepCols> findWorkStepCols(
			final WorkStep workStep) {
		return (Collection<WorkStepCols>)this.getHibernateTemplate().execute(new HibernateCallback() {
			@Override
			public Object doInHibernate(Session arg0)
					throws HibernateException, SQLException {
				// TODO Auto-generated method stub
				Criteria criteria = arg0.createCriteria(WorkStepCols.class);
				criteria.add(Restrictions.eq("workStep", workStep));
				return criteria.list();
			}
			
		});
	}

}
